<?php

global $wpdb;

$update = braille_options::update();

$scheme_name = get_option('braille_style');
$scheme_title = $scheme_name !== false ? $scheme_name : __('No Scheme', 'braille');

$scheme_files = braille::files_scan(TEMPLATEPATH . '/schemes/', 'css', 2);

?>

<?php if(isset($_POST['submit'])) { ?>
<div id="message2" class="updated fade">
	<p><?php _e('Braille Options have been updated', 'braille'); ?></p>
</div>
<?php } ?>

<div class="wrap">

	<form name="dofollow" action="" method="post">
		<input type="hidden" name="action" value="<?php echo($update); ?>" />
		<input type="hidden" name="page_options" value="'dofollow_timeout'" />

		<div class="configure">
			<h2><?php _e('Braille Options', 'braille'); ?></h2>
			
			<p class="submit">
				<input type="submit" name="submit" value="<?php _e('Update Options', 'braille'); ?> &raquo;" />
			</p>
			
			<table cellpadding="5">
				<tr valign="top">
					<th><?php _e('Custom Scheme', 'braille') ?></th>
					<td>
						<select id="braille-style" name="braille[style]">
							<option value=""<?php selected($scheme_name, ''); ?>><?php _e('No Scheme', 'braille'); ?></option>
						<?php foreach($scheme_files as $scheme_file) { ?>
							<option value="<?php echo($scheme_file); ?>"<?php selected($scheme_name, $scheme_file); ?>><?php echo($scheme_file); ?></option>
						<?php } ?>
						</select>
					</td>
				</tr>
				<tr valign="top">
					<th><?php _e('About Text', 'braille') ?></th>
					<td><textarea id="braille-about" name="braille[about]" rows="6" cols="30"><?php echo stripslashes(get_option('braille_about')); ?></textarea></td>
				</tr>
				<tr valign="top">
					<th><?php echo wptexturize(__('Rename the "Blog" tab', 'braille')); ?></th>
					<td><input id="braille-tab" name="braille[tab]" value="<?php echo stripslashes(get_option('braille_tab')); ?>" /></td>
				</tr>
				<tr valign="top">
					<th><?php _e('LiveSearch', 'braille'); ?></th>
					<td>
						<input id="braille-search" name="braille[search]" type="checkbox" value="1" <?php checked('1', get_option('braille_search')); ?> />
						<?php _e('Enable LiveSearch', 'braille'); ?>
					</td>
				</tr>
				<tr valign="top">
					<th><?php _e('Archives', 'braille'); ?></th>
					<td>
						<input id="braille-archives" name="braille[archives]" type="checkbox" value="1" <?php checked('1', get_option('braille_archives')); ?> />
						<?php _e('Enable Archives Page', 'braille'); ?>
					</td>
				</tr>
			</table>
			
			<p class="submit">
				<input type="submit" name="submit" value="<?php _e('Update Options', 'braille'); ?> &raquo;" />
			</p>
			
			<h2><?php _e('Uninstall Braille', 'braille'); ?></h2>
			<p><?php _e('Pressing the delete button doesn\'t delete any of the Braille theme files nor the Braille theme directory. It simply removes all the Braille settings from the database and reverts back to the default theme.', 'braille'); ?></p>
			
			<p class="submit">
				<input id="uninstall" name="uninstall" type="submit" value="<?php _e('Delete Options', 'braille'); ?> &raquo;" />
			</p>
		</div>

	</form>
</div>